package com.smfx.yxt;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.smfx.yxt.model.TeacherInfo;
import com.smfx.yxt.service.ITeacherService;
import com.smfx.yxt.wechat.utils.WechatUtils;

public class UnionService extends BaseTest{

	@Autowired
	private ITeacherService teacherService;
	
	@Test
	public void teacherUnionId() {
		List<TeacherInfo> list = teacherService.selectList();
		for(TeacherInfo record : list) {
			if(StringUtils.isNotBlank(record.getOpenid2())) {
				WechatUtils.getUserInfo("10_zoNDjKcwzRQ0i8ZibkftveYw2RKRPShCrTupdyrOtLw7qcDC8mJOmbw5WDMBoEFV-nb6iVxKdbjS5Cjht9oOZEpX-Sc4Qrj0T-MS8xpdJ7VlFMkALq1iICdjF0HTEeb08_nA0evCLplfLKm1THLfAJAYMQ", record.getOpenid2());
				teacherService.updateById(record);
			}
		}
	}
}
